﻿@model HQPad.Models.InvocationListModel

<h2>Invocations</h2>

@if (Model != null && Model.Invocations.Count > 0)
{
<table class="invocations-list">
    <thead>
        <th>Sphere</th>
        <th>Sect</th>
        <th>Name</th>
        <th class="centred">Rank</th>
        <th class="centred">Known</th>
    </thead>
    <tbody>
        @foreach (var invocation in Model.Invocations)
        {
            <tr @Html.Raw("class='" + invocation.Sphere.ToLower() + "-invocation" + ((invocation.Selected) ? " invocation-known" : "") + "'") @Html.Raw("data-group-name='" + invocation.Group + "'") @Html.Raw("data-sect='" + invocation.SectSlug.ToLower().Replace("-","_") + "'") @Html.Raw("data-type='" + Enum.GetName(typeof(HQPad.Helpers.SectStatusAssignmentType), invocation.AssignmentType).ToLower().ToLower() + "'") >
                <td class="invocation-colour">@Html.Raw(invocation.Sphere)</td>
                <td>@Html.Raw(invocation.SectName)</td>
                <td>@Html.Raw(invocation.Name)</td>
                <td class="centred">@Html.Raw(invocation.Rank)</td>
                <td class="centred">@Html.CheckBox(string.Format("invocation_known_{0}", invocation.Group), invocation.Selected, new { @class = "invocation-selected" })</td>
            </tr>
        }
    </tbody>
</table>
}
else
{
    <p>There are no available invocations.</p>
}